package com.fxkj.cloud.drms.domain.linkage;

import com.fxkj.cloud.dbs.common.model.kv.TsKvEntry;
import com.fxkj.cloud.dbs.common.model.linkage.FxTrigger;


import java.util.List;
import java.util.Set;
import java.util.UUID;

/**
 * <p>description: </p>
 * @author ww
 * @date 2025/3/28 13:48
 */
public class FxTriggerFilterChain implements AnyMatchFilterChain {
    private final List<FxTrigger> triggers;

    public FxTriggerFilterChain(List<FxTrigger> triggers) {
        this.triggers = triggers;
    }

    @Override
    public Boolean anyMatch(UUID deviceId, List<TsKvEntry> deviceKvs) {
        return triggers.stream().anyMatch((trigger) -> trigger.match(deviceId, deviceKvs));
    }

}
